import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from "@/views/LoginView.vue";
import MenuView from "@/views/MenuView.vue";
import UserView from "@/views/UserView.vue";
import RoleView from "@/views/RoleView.vue";
import CaiDanView from "@/views/CaiDanView.vue";
import DeptView from "@/views/DeptView.vue";
import PostView from "@/views/PostView.vue";
import DictionaryView from "@/views/DictionaryView.vue";
import JianKongView from "@/views/JianKongView.vue";
import LogsView from "@/views/LogsView.vue";
import CropsView from "@/views/CropsView.vue";
import LogisticsView from "@/views/LogisticsView.vue";
import OperateView from "@/views/OperateView.vue";
import MessageView from "@/views/MessageView.vue";
import ShelfView from "@/views/ShelfView.vue";
import GoodsView from "@/views/GoodsView.vue";
import OrderView from "@/views/OrderView.vue";
import CartView from "@/views/CartView.vue";
import QrCodeDetailsView from "@/views/QrCodeDetailsView.vue";
import CouponView from "@/views/CouponView.vue";
import BlankView from "@/views/BlankView.vue";


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginView
  },{
    path: '/register',
    name: 'register',
    component: () => import(/* webpackChunkName: "about" */ '../views/RegisterView.vue')
  },{
    path: '/menu',
    name: 'menu',
    component: MenuView,
    children:[
      {
        path: '/user',
        name: 'user',
        component: UserView
      },{
        path: '/role',
        name: 'role',
        component: RoleView
      },
      {
        path: '/caidan',
        name: 'caidan',
        component: CaiDanView
      },
      {
        path: '/dept',
        name: 'dept',
        component: DeptView
      },
      {
        path: '/post',
        name: 'post',
        component: PostView
      },
      {
        path: '/dictionary',
        name: 'dictionary',
        component: DictionaryView
      },
      {
        path: '/jiankong',
        name: 'jiankong',
        component: JianKongView
      },
      {
        path: '/logs',
        name: 'logs',
        component: LogsView,
      },
      {
        path: '/crops',
        name: 'crops',
        component: CropsView,
      },{
        path: '/siji',
        name: 'siji',
        component: () => import(/* webpackChunkName: "about" */ '../views/SijiView.vue')
      },{
        path: '/logistics',
        name: 'logistics',
        component: LogisticsView
      },{
        path: '/operation',
        name: 'operation',
        component: OperateView
      },{
        path: '/messages',
        name: 'messages',
        component: MessageView
      },{
        path: '/shangjia',
        name: 'shangjia',
        component: ShelfView
      },{
        path: '/goods',
        name: 'goods',
        component: GoodsView
      },{
        path: '/order',
        name: 'order',
        component: OrderView
      },{
        path: '/cart',
        name: 'cart',
        component: CartView
      },{
        path: '/qrcode',
        name: 'qrcode',
        component: QrCodeDetailsView
      },{
        path: '/coupon',
        name: 'coupon',
        component: CouponView
      },{
        path: '/blank',
        name: 'blank',
        component: BlankView
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
